package net.xdclass.feign;

import io.swagger.annotations.ApiParam;
import net.xdclass.request.ConfirmOrderCartItems;
import net.xdclass.request.LockProductRequest;
import net.xdclass.utils.JsonData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(name = "xdclass-product-service")
public interface ProductFeignService {

    /**
     * 获取购物车里商品的最新价格(也会清空对应的购物车商品)
     * @param confirmOrderCartItems
     * @return
     */
    @PostMapping("/api/cart/v1/confirm_order_cart_items")
    JsonData confirmOrderCartItem(@RequestBody ConfirmOrderCartItems confirmOrderCartItems);

    /**
     * 锁定商品库存
     * @param lockProductRequest
     * @return
     */
    @PostMapping("/api/product/v1/lock_products")
    JsonData lockProducts(@ApiParam("商品库存锁定") @RequestBody LockProductRequest lockProductRequest);
}
